package review;

/**
 * @author oldliu
 * @since 1.0
 */
public class Dog {
    public static int Legs=4;
    public String name;
    public int age;
    static {
        System.out.println("从单细胞进化冷血动物，进化到哺乳动物，到了狗");
        System.out.println(Legs+"条腿");
    }
    {//构造块
        System.out.println("准备创建一条狗");
    }
    public Dog(){

    }

    public Dog(String name) {
        this.name = name;
    }

    public Dog(int age) {
        this.age = age;
    }

    public Dog(String name, int age) {
        this.name = name;
        this.age = age;
    }

    @Override
    public String toString() {
        return "Dog{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
